home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / DCLAP 4j / DClap / Dvibrant.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-17  |  15.8 KB  |  605 lines  |  [TEXT/R*ch]

  1. /* Dvibrant.c */
  2. /* dgg additions to ncbi/vibrant */
  3.  
  4.  
  5. #include "Dvibrant.h"
  6.  
  7. /* one of the mac libs conflicts w/ these defs */
  8. #undef true
  9. #undef false
  10.  
  11. #include <ncbi.h>
  12. #include <ncbidraw.h>
  13. #include <ncbiwin.h>
  14. #include <ncbiport.h>
  15. #include <vibincld.h>
  16.  
  17. void Dgg_PenNormal()  /* nlmdraw addition */
  18. {
  19.     Nlm_Black();
  20.     Nlm_Solid();
  21.     Nlm_WidePen(1); /* << !? need Nlm_PenNormal() */
  22. }
  23.  
  24. extern void Dgg_DrawTextbox (Nlm_RectPtr r, Nlm_CharPtr text,
  25.                                ulong len, Nlm_Char jst, Nlm_Boolean gray)
  26. {
  27. /* from Nlm_DrawText which mostly does this, but XWin XDrawString primitive doesn't know about
  28.    multiline text */
  29.    
  30. #ifdef WIN_MAC
  31.   Nlm_Int2      just;
  32.   PenState      pnState;
  33.   Nlm_RectTool  rtool;
  34.  
  35.   if (r != NULL) {
  36.     Nlm_EraseRect (r);
  37.     if (text != NULL && len > 0) {
  38.       Nlm_RecTToRectTool (r, &rtool);
  39.       switch (jst) {
  40.         case 'r':
  41.           just = -1;
  42.           break;
  43.         case 'l':
  44.           just = 0;
  45.           break;
  46.         case 'c':
  47.           just = 1;
  48.           break;
  49.         default:
  50.           just = 0;
  51.           break;
  52.       }
  53.       TextBox (text, len, &rtool, just);
  54.       if (gray) {
  55.         GetPenState (&pnState);
  56.         PenMode (patBic);
  57.         /*PenPat ((ConstPatternParam) grayPat);*/
  58.                 Nlm_Medium();
  59.         PaintRect (&rtool);
  60.         SetPenState (&pnState);
  61.       }
  62.     }
  63.   }
  64. #endif
  65. #ifdef WIN_MSWIN
  66.   Nlm_Int2      format;
  67.   Nlm_Int4      oldcolor;
  68.   Nlm_RectTool  rtool;
  69.  
  70.   if (r != NULL && Nlm_currentHDC != NULL) {
  71.     Nlm_RecTToRectTool (r, &rtool);
  72.     if (Nlm_currentHWnd != NULL) {
  73.       Nlm_EraseRect (r);
  74.     } else {
  75.       FillRect (Nlm_currentHDC, &rtool, GetStockObject (WHITE_BRUSH));
  76.     }
  77.     if (text != NULL && len > 0) {
  78.       switch (jst) {
  79.         case 'r':
  80.           format = DT_RIGHT;
  81.           break;
  82.         case 'l':
  83.           format = DT_LEFT;
  84.           break;
  85.         case 'c':
  86.           format = DT_CENTER;
  87.           break;
  88.         default:
  89.           format = DT_LEFT;
  90.           break;
  91.       }
  92.       if (gray) {
  93.         oldcolor = SetTextColor (Nlm_currentHDC, GetSysColor (COLOR_GRAYTEXT));
  94.       }
  95.       DrawText (Nlm_currentHDC, text, (Nlm_Int2) len, &rtool,
  96.                 format | DT_VCENTER | DT_NOPREFIX);
  97.       if (gray) {
  98.         SetTextColor (Nlm_currentHDC, oldcolor);
  99.       }
  100.     }
  101.   }
  102. #endif
  103.  
  104. #ifdef WIN_MOTIF
  105.   Nlm_Int2   delta;
  106.   Nlm_Int2   height;
  107.   Nlm_Int2   limit;
  108.   Pixmap     pix;
  109.   Nlm_PoinT  pt;
  110.   Nlm_Int2   width;
  111.  
  112.   if (r != NULL && Nlm_currentXDisplay != NULL &&
  113.       Nlm_currentXWindow != 0 && Nlm_currentXGC != NULL) {
  114.     Nlm_EraseRect (r);
  115.     if (text != NULL && len > 0) {
  116.             Nlm_Int4  widlimit, pixwid, linewid, nlines;
  117.             Nlm_Int2    atx, liney;
  118.             char    *cp, *cp0;
  119.             
  120.       pt.x = r->left - Nlm_XOffset;
  121.       pt.y = r->top - Nlm_YOffset;
  122.             nlines= 0;
  123.             cp0= text;
  124.             do {
  125.                 nlines++;
  126.                 cp= Nlm_StrChr(cp0, '\n');  
  127.                 if (cp) cp0= 1 + cp;
  128.             } while (cp);
  129.  
  130.          width= 0;
  131.         widlimit = ABS(r->right - r->left);
  132.             limit = ABS(r->bottom - r->top);
  133.       height = Nlm_LineHeight();
  134.             delta = limit - nlines * height; 
  135.             if (delta > 0) pt.y += delta / 2;   
  136.             liney= pt.y + Nlm_Ascent();
  137.             
  138.             cp0= text;
  139.         if (gray) Nlm_Medium();
  140.             do {
  141.                 nlines++;
  142.                 cp= Nlm_StrChr(cp0, '\n');  
  143.                 if (cp) linewid= cp - cp0;
  144.                 else linewid= len - (cp0 - text);
  145.                     
  146.                 pixwid= Nlm_TextWidth (cp0, linewid);
  147.                 if (pixwid > widlimit) {
  148.                     linewid= Min(linewid, 1 + widlimit / Nlm_MaxCharWidth());
  149.                     pixwid= Nlm_TextWidth(cp0, linewid);
  150.                     while (linewid > 0 && pixwid > widlimit) {
  151.                 linewid--;
  152.                 pixwid = Nlm_TextWidth (cp0, linewid);
  153.                   }
  154.                     }
  155.                 
  156.                 delta = widlimit - pixwid;
  157.                 if (delta>0) switch (jst) {
  158.                     case 'r':
  159.                         atx = pt.x + delta;
  160.                         break;
  161.                     default:
  162.                     case 'l':
  163.                         atx = pt.x;
  164.                         break;
  165.                     case 'c':
  166.                         atx = pt.x + delta / 2;
  167.                         break;
  168.                     }
  169.                  
  170.                 XDrawString (Nlm_currentXDisplay, Nlm_currentXWindow, Nlm_currentXGC,
  171.                                          atx, liney, cp0, (int) linewid);
  172.                 liney += height; 
  173.                 
  174.                 if (cp) {
  175.                     if (linewid < cp - cp0) cp0 += linewid; 
  176.                     else cp0 = 1+cp;
  177.                     }
  178.                 else if (cp0 + linewid < text + len) {
  179.                     cp0= cp0 + linewid;
  180.                     cp= cp0;
  181.                     }
  182.             } while (cp);
  183.     if (gray) Nlm_Solid();
  184.     
  185.     }
  186.   }
  187. #endif
  188. }
  189.  
  190.  
  191.  
  192.  
  193. extern void Dgg_SetParentWindow (Nlm_GraphiC a, Nlm_WindoW newwindow)
  194. {
  195.   Nlm_GraphiC  child, g, p;
  196.  
  197.   g = a;
  198.   if (a != NULL) {
  199.           child= g;
  200.     p = Nlm_GetParent (g);
  201.     while (p != NULL) {
  202.                child= g;
  203.       g = p;
  204.       p = Nlm_GetParent (g);
  205.     }
  206.   /* g == window, child == a primary subview in window */
  207.   if (child != NULL) Nlm_SetParent( child, (Nlm_GraphiC) newwindow);
  208.   }
  209. }
  210.  
  211.  
  212.  
  213. #ifdef WIN_MAC
  214.  
  215. /* LaunchFileThruFinder perpares and sends the Finder OpenSelection event */
  216.  
  217. #include <Processes.h>
  218. #include <GestaltEqu.h>
  219. #include <AppleEvents.h>
  220. #include <Aliases.h>
  221.  
  222.  
  223.         // from MacAppUtilities.cp
  224. OSErr FindProcessBySignature(OSType sig, ProcessSerialNumber* psn, FSSpec* fileSpec)
  225. {
  226.     OSErr err;
  227.     ProcessInfoRec info;
  228.  
  229.     psn->highLongOfPSN = 0;
  230.     psn->lowLongOfPSN  = kNoProcess;
  231.     do {
  232.         err= GetNextProcess(psn);
  233.         if( err == noErr ) {
  234.             info.processInfoLength = sizeof(ProcessInfoRec);
  235.             info.processName = NULL;
  236.             info.processAppSpec = fileSpec;
  237.             err= GetProcessInformation(psn, &info);
  238.         }
  239.     } while( (err == noErr) && info.processSignature != sig );
  240.  
  241.     if( err == noErr ) (*psn) = info.processNumber;
  242.  
  243.     return err;
  244. }  
  245.  
  246.  
  247. OSErr LaunchFileSpecThruFinder( FSSpec fileToLaunch)
  248. {                    
  249.     const        OSType aeSelectionKeyword    = 'fsel';
  250.     const        OSType kAEOpenSelection        = 'sope';
  251.     const        OSType kFinderType                 = 'FNDR';
  252.     const        OSType kSysCreator                 = 'MACS';
  253.     
  254.     AppleEvent    aeEvent, aeReply;
  255.     AEDesc            myAddressDesc, aeDirDesc, listElem;
  256.     FSSpec            dirSpec, procSpec;
  257.     AEDesc            fileList;
  258.     OSErr                myErr;
  259.     ProcessSerialNumber        finderSN;
  260.     AliasHandle    DirAlias, FileAlias;
  261.                 
  262.     DirAlias= NULL;
  263.     FileAlias= NULL;
  264.     aeEvent.dataHandle= NULL;
  265.     
  266.         // find the finder on this machine 
  267. // failing here w/ no finder !?
  268.     myErr= FindProcessBySignature(kFinderType, &finderSN, &procSpec);
  269. //    if (myErr!=0) return procNotFound;
  270.     if (myErr != 0) { // do the hard way...
  271.         ProcessSerialNumber    processSN;
  272.     ProcessInfoRec infoRec;
  273.     Str31 processName;
  274.     FSSpec procSpec;
  275.     Boolean notFinder = true;
  276.  
  277.     processSN.lowLongOfPSN = kNoProcess;
  278.     processSN.highLongOfPSN = kNoProcess;
  279.         do {
  280.         myErr = GetNextProcess(&processSN);
  281.                 infoRec.processInfoLength = sizeof(ProcessInfoRec);
  282.                 infoRec.processName = (StringPtr)&processName;
  283.                 infoRec.processAppSpec = &procSpec;
  284.         GetProcessInformation(&processSN, &infoRec);
  285.                 if (infoRec.processSignature == kSysCreator 
  286.                  && infoRec.processType == kFinderType) {
  287.                     finderSN = processSN;
  288.                     notFinder = false;
  289.                     }
  290.             } while (notFinder && !myErr);    
  291.         }
  292.         
  293.         
  294.     myErr= AECreateDesc(typeProcessSerialNumber, (Ptr) &finderSN, sizeof(finderSN), 
  295.                                                 &myAddressDesc);
  296.     if (myErr != noErr) return myErr;
  297.     
  298.             // Create the FinderEvent 
  299.     myErr= AECreateAppleEvent(kFinderType, kAEOpenSelection, &myAddressDesc, 
  300.                                             kAutoGenerateReturnID, kAnyTransactionID, &aeEvent);
  301.     if (myErr != noErr) return myErr;
  302.     
  303.     // Now we build all the bits of an OpenSelection event. 
  304.     //  Basically, we need to create an alias for the item to open, and an alias to the parent 
  305.     // folder (directory) of that item.  We can also pass a list of files if we want.  
  306.     // Youll notice that for opening a finder window, the file and directory alias both point at the 
  307.     // folder itself. Make a spec for the parent folder  
  308.      
  309.         //  create the folder descriptor 
  310.     myErr= FSMakeFSSpec( fileToLaunch.vRefNum, fileToLaunch.parID, NULL, &dirSpec);
  311.     
  312.     myErr= NewAlias( NULL, &dirSpec, &DirAlias);
  313.     HLock( (Handle) DirAlias);
  314.     myErr= AECreateDesc(typeAlias, (Ptr) *DirAlias, GetHandleSize( (Handle) DirAlias), 
  315.                                 &aeDirDesc);
  316.     HUnlock( (Handle)DirAlias);
  317.     DisposHandle( (Handle) DirAlias);
  318.     
  319.     myErr= AEPutParamDesc( &aeEvent, keyDirectObject, &aeDirDesc);
  320.     if (myErr != noErr) return myErr;
  321.     myErr= AEDisposeDesc( &aeDirDesc);
  322.     
  323.             // create the file descriptor and add to aliasList 
  324.     myErr= NewAlias( NULL, &fileToLaunch, &FileAlias);
  325.     HLock( (Handle)FileAlias);
  326.     myErr= AECreateDesc(typeAlias, (Ptr)*FileAlias, GetHandleSize( (Handle)FileAlias), 
  327.                                     &listElem);
  328.     HUnlock( (Handle)FileAlias);
  329.     DisposHandle( (Handle)FileAlias);
  330.     
  331.         // Create the file  list 
  332.     myErr= AECreateList(NULL, 0, false, &fileList);
  333.     if (myErr != noErr) return myErr;
  334.     
  335.     myErr= AEPutDesc( &fileList, 0, &listElem);
  336.     (void) AEDisposeDesc( &listElem);
  337.     if (myErr != noErr) return myErr;
  338.     
  339.         // Add the file alias list to the event 
  340.     myErr= AEPutParamDesc( &aeEvent, aeSelectionKeyword, &fileList);
  341.     (void) AEDisposeDesc( &fileList);
  342.     if (myErr != noErr) return myErr;
  343.  
  344.     myErr= AESend( &aeEvent, &aeReply, kAENoReply + kAEAlwaysInteract + kAECanSwitchLayer,
  345.                                          kAENormalPriority, kAEDefaultTimeout, NULL, NULL);
  346.         
  347.     (void) AEDisposeDesc( &aeEvent);
  348.     return myErr;
  349. }
  350.  
  351. #endif
  352.  
  353.  
  354. #ifdef WIN_MAC
  355. /* quick hack to check child apps by psn */
  356. ProcessSerialNumber  gChildProcessSN;
  357. #else
  358. long         gChildProcessSN;
  359. #endif
  360.  
  361.  
  362. #ifdef WIN_MAC
  363. char* Fullpathname( char* filename)
  364. {
  365.     static char    pathname [512]; /* ?? is there a 256 char limit on mac paths ?? */
  366.   Nlm_CharPtr          ptr;
  367.  
  368.     if (Nlm_StringChr( filename, DIRDELIMCHR) != NULL) 
  369.         Nlm_StringNCpy ((Nlm_CharPtr) pathname, filename, sizeof (pathname));
  370.     else {
  371.         Nlm_ProgramPath((Nlm_CharPtr) pathname, sizeof (pathname));
  372.         ptr = Nlm_StringRChr((Nlm_CharPtr) pathname, DIRDELIMCHR);
  373.         if (ptr)  *ptr = '\0';
  374.         Nlm_FileBuildPath((Nlm_CharPtr) pathname, NULL, filename);
  375.         }
  376.     return pathname;
  377. }
  378. #endif
  379.  
  380.  
  381. extern Nlm_Boolean Dgg_LaunchApp( char* appName, char* commandline,
  382.                                                     char* Stdin, char* Stdout, char* Stderr)
  383. {
  384. #ifdef WIN_MAC
  385.   OSErr                              err;
  386.   FSSpec               fsspec;
  387.   long                 gval;
  388.   LaunchParamBlockRec  lparm;
  389.     //unsigned char *      pathname[256];  
  390.   Nlm_CharPtr          pathname, ptr;
  391.   Nlm_Boolean          rsult;
  392.  
  393.   rsult = FALSE;
  394.   if (Gestalt (gestaltSystemVersion, &gval) == noErr && (short) gval >= 7 * 256) {
  395.     if (appName && *appName) {
  396.             pathname= Fullpathname( appName);
  397.             Nlm_CtoPstr((Nlm_CharPtr) pathname);
  398.             err = FSMakeFSSpec(0, 0, (unsigned char*)pathname, &(fsspec));
  399.             
  400.             if (Stdin || Stdout || Stderr) {
  401.                 if (!commandline) commandline= MemNew(1);
  402.                 if (Stdin) {
  403.                     pathname= Fullpathname(Stdin);
  404.                     commandline= MemMore( commandline, StrLen(commandline) + 6 + StrLen(pathname));
  405.                     StrCat( commandline, " < '");
  406.                     StrCat( commandline, pathname);
  407.                     StrCat( commandline, "'");
  408.                     }
  409.                 if (Stdout) {
  410.                     pathname= Fullpathname(Stdout);
  411.                     commandline= MemMore( commandline, StrLen(commandline) + 6 + StrLen(pathname));
  412.                     StrCat( commandline, " > '");
  413.                     StrCat( commandline, pathname);
  414.                     StrCat( commandline, "'");
  415.                     }
  416.                 if (Stderr) {
  417.                     pathname= Fullpathname(Stderr);
  418.                     commandline= MemMore( commandline, StrLen(commandline) + 6 + StrLen(pathname));
  419.                     StrCat( commandline, " 2> '");
  420.                     StrCat( commandline, pathname);
  421.                     StrCat( commandline, "'");
  422.                     }
  423.                 }
  424.                 
  425.             if (commandline) {
  426.                 /* only good for launching an application, not a document... */
  427.                 EventRecord hlevt;
  428.               AppParametersPtr appParams;
  429.                 long    len;
  430.  
  431.                 MemSet( &lparm, 0, sizeof(lparm));
  432.               len= 2 + StrLen(appName) + StrLen( commandline);
  433.                 hlevt.what= kHighLevelEvent;
  434.                 hlevt.message= 'DClp'; // ID of sender == DClap application
  435.                 hlevt.where.v= 'Cm';  
  436.                 hlevt.where.h= 'dl'; //(Point)'Cmdl';     // command line event type
  437.                 
  438.               appParams= (AppParametersPtr) MemNew( sizeof(AppParameters) + len + 2);
  439.                 appParams->theMsgEvent= hlevt;
  440.                 appParams->eventRefCon= 'Cmdl'; // ?? again
  441.                 ptr= (char*) &(appParams->messageLength) + sizeof(long);
  442.                 StrCpy( ptr, appName);
  443.                 StrCat( ptr, " ");
  444.                 StrCat( ptr, commandline); 
  445.                 appParams->messageLength= len;
  446.                 lparm.launchAppParameters = appParams;
  447.                     
  448.                 lparm.launchBlockID = extendedBlock;
  449.                 lparm.launchEPBLength = extendedBlockLen;
  450.                 lparm.launchFileFlags = 0;
  451.                 lparm.launchControlFlags = launchContinue + launchNoFileFlags;
  452.                 lparm.launchAppSpec = &fsspec;
  453.                 err= LaunchApplication (&lparm);
  454.                 rsult= (err == noErr);
  455.                 gChildProcessSN= lparm.launchProcessSN;
  456.                 
  457.                 MemFree( appParams);
  458.                 }
  459.             else {
  460.                  rsult = (Nlm_Boolean) (LaunchFileSpecThruFinder( fsspec)  == noErr);
  461.                  }
  462.         }
  463.       }
  464.   return rsult;
  465. #endif
  466.  
  467. #ifdef WIN_MSWIN
  468.   Nlm_Char     ch;
  469.   Nlm_Int2     i, j, k;
  470.   Nlm_Uint2         val;
  471.   char         lpszCmdLine [256];
  472.   Nlm_Boolean  rsult;
  473.  
  474.   rsult = FALSE;
  475.   if ((appName && *appName) || (commandline && *commandline)) {
  476.         *lpszCmdLine= 0;
  477.         if (appName) { 
  478.         Nlm_StringNCpy ((Nlm_CharPtr) lpszCmdLine, appName, sizeof (lpszCmdLine));
  479.         Nlm_StringNCat ((Nlm_CharPtr) lpszCmdLine, " ", sizeof (lpszCmdLine));
  480.         }
  481.     Nlm_StringNCat ((Nlm_CharPtr) lpszCmdLine, commandline, sizeof (lpszCmdLine));
  482.  
  483.                 /* leave in all the nasty command line parameters.... */
  484. #ifdef LEAVE_OUT_NASTY_PARAMETERS
  485.     i = 0;
  486.     j = 0;
  487.     k = 0;
  488.     ch = appName [j];
  489.     while (i < 8 && ch != '\0') {
  490.       if (ch == '_' || IS_ALPHANUM (ch)) {
  491.         lpszCmdLine [k] = ch;
  492.         j++;
  493.         k++;
  494.         ch = appName [j];
  495.       }
  496.       i++;
  497.     }
  498.     while (ch != '\0' && ch != '.') {
  499.       j++;
  500.       ch = appName [j];
  501.     }
  502.     if (ch == '.') {
  503.       lpszCmdLine [k] = ch;
  504.       j++;
  505.       k++;
  506.       ch = appName [j];
  507.       i = 0;
  508.       while (i < 3 && ch != '\0') {
  509.         if (ch == '_' || IS_ALPHANUM (ch)) {
  510.           lpszCmdLine [k] = ch;
  511.           j++;
  512.           k++;
  513.           ch = appName [j];
  514.         }
  515.         i++;
  516.       }
  517.     }
  518.     if (k > 0 && lpszCmdLine [k - 1] == '.') {
  519.       lpszCmdLine [k - 1] = '\0';
  520.     }
  521.     lpszCmdLine [k] = '\0';
  522. #endif
  523.  
  524.     val= WinExec (lpszCmdLine, SW_SHOW);
  525.     gChildProcessSN= val;
  526.     rsult= (val >= 32);
  527.   }
  528.   return rsult;
  529. #endif
  530.  
  531.  
  532. #ifdef WIN_MOTIF
  533.   Nlm_Boolean  rsult;
  534.   long              status;
  535.  
  536.   rsult = FALSE;
  537.   if ((appName && *appName) || (commandline && *commandline)) {
  538.     int          narg = 0, done;
  539.     char        *cmdline, **argv, *cp, *ep;
  540.     ulong     len;
  541.     
  542.         len= StrLen(appName) + StrLen(commandline) + 3;
  543.         cmdline= MemNew(len);
  544.         *cmdline= 0;
  545.         if (appName) { 
  546.             Nlm_StringCpy( cmdline, appName);
  547.             Nlm_StringCat( cmdline, " ");
  548.             }
  549.         Nlm_StringCat( cmdline, commandline);
  550.         
  551.        /* need to pop the cmdline args into a vector !*/
  552.     cp= cmdline; done= FALSE;
  553.     argv= (char**) Nlm_MemNew(sizeof(Nlm_CharPtr));
  554.     while (!done) {
  555.        while (*cp && *cp <= ' ') cp++;
  556.        if (*cp == '"') { for (ep= cp+1; *ep && *ep != '"'; ep++) ; }
  557.        else if (*cp == '\'') { for (ep= cp+1; *ep && *ep != '\''; ep++) ; }
  558.        else if (*cp) { for (ep= cp+1; *ep && *ep>' '; ep++) ; }
  559.        if (*ep) *ep= '\0';  else done= TRUE;
  560.        narg++;
  561.        argv= (char**) Nlm_MemMore(argv, (narg+1) * sizeof(Nlm_CharPtr));
  562. /*xdebugp("Dgg_LaunchFile argv[i]= %s\n",cp);*/
  563.        argv[narg-1]= cp;
  564.        cp= ep+1;
  565.        }
  566.     argv[narg]= NULL;
  567.  
  568. #ifdef OS_UNIX
  569.     status =  fork();
  570.     if (status == 0) {
  571.         /* if status==0, we are now the child process */
  572.             if (Stdin) freopen( Stdin, "r", stdin);
  573.             if (Stdout) freopen( Stdout, "a", stdout);
  574.             if (Stderr) freopen( Stderr, "a", stderr);
  575.       execvp( argv[0], argv);
  576.       /* if (stillhere) Nlm_Message (MSG_FATAL, "Application launch failed"); */
  577.       _exit(-1); /* app launch failed if we get here... */
  578.         } 
  579.     else if (status != -1) {
  580.         /* here status == child process id, need to save for child app handler */
  581.         gChildProcessSN= status;
  582.       rsult = TRUE;
  583.         }
  584.     else
  585.            Nlm_Message (MSG_OK, "Application launch failed");  
  586.  
  587. #endif
  588. #ifdef OS_VMS
  589.         /* ?? for VMS -- how do we change child process stdin/stdout/stderr ?? */
  590.     status = execvp( argv[0], argv);
  591.     if ( status == -1 ) {
  592.       /*Nlm_Message (MSG_FATAL, "Application launch failed"); */
  593.         } 
  594.     else {
  595.         gChildProcessSN= status;
  596.         /* here status == child process id, need to save for child app handler */
  597.       rsult = TRUE;
  598.         }
  599. #endif
  600.     Nlm_MemFree(cmdline);
  601.   }
  602.   return rsult;
  603. #endif
  604. }
  605.